home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / one_scrs / asm / timer.asm < prev    next >
Encoding:
Assembly Source File  |  1996-07-18  |  2.7 KB  |  117 lines

  1. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2. ;
  3. ; Counting Timer Routine
  4. ;
  5. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  6.  
  7. ;120*13
  8.  
  9.         public  puttimer
  10.         public  dectimer
  11.  
  12.         tc1     db      0
  13.         tc2     db      0
  14.         tc3     db      0
  15.         tc4     db      0
  16.         tc5     db      1
  17.         tc6     db      0
  18.         timerc  db      0
  19.  
  20. dectimer:
  21.         cmp     tc1,0
  22.         je      nn1
  23.         dec     tc1
  24.         jmp     endit
  25. nn1:    mov     tc1,9
  26.         cmp     tc2,0
  27.         je      nn2
  28.         dec     tc2
  29.         jmp     endit
  30. nn2:    mov     tc2,9
  31.         cmp     tc3,0
  32.         je      nn3
  33.         dec     tc3
  34.         jmp     endit
  35. nn3:    mov     tc3,9
  36.         cmp     tc4,0
  37.         je      nn4
  38.         dec     tc4
  39.         jmp     endit
  40. nn4:    mov     tc4,9
  41.         cmp     tc5,0
  42.         je      nn5
  43.         dec     tc5
  44.         jmp     endit
  45. nn5:    mov     tc5,9
  46.         cmp     tc6,0
  47.         je      nn6
  48.         dec     tc6
  49.         jmp     endit
  50. nn6:    mov     tc6,9
  51. endit:  ret
  52.  
  53. puttimer:
  54.         mov     edi,[esp+4]
  55.         mov     eax,[esp+8]
  56.         mov     timerc,al
  57.         add     edi,320*175+25
  58.         lea     esi,numbers
  59.         mov     eax,0
  60.         mov     ebp,0
  61.         mov     al,tc6
  62.         imul    eax,12
  63.         call    putnumber      
  64.         mov     eax,0
  65.         mov     ebp,11*1
  66.         mov     al,tc5
  67.         imul    eax,12
  68.         call    putnumber
  69.         mov     eax,10
  70.         mov     ebp,11*2
  71.         imul    eax,12
  72.         call    putnumber
  73.         mov     eax,0
  74.         mov     ebp,11*3  - 5
  75.         mov     al,tc4
  76.         imul    eax,12
  77.         call    putnumber
  78.         mov     eax,0
  79.         mov     ebp,11*4  - 5
  80.         mov     al,tc3
  81.         imul    eax,12
  82.         call    putnumber
  83.         mov     eax,10
  84.         mov     ebp,11*5  - 5
  85.         imul    eax,12
  86.         call    putnumber
  87.         mov     eax,0
  88.         mov     ebp,11*6  - 5 - 5
  89.         mov     al,tc2
  90.         imul    eax,12
  91.         call    putnumber
  92.         mov     eax,0
  93.         mov     ebp,11*7  - 5 - 5
  94.         mov     al,tc1
  95.         imul    eax,12
  96.         call    putnumber
  97.         ret
  98.  
  99. putnumber:
  100.         mov     bl,timerc
  101.         mov     edx,13
  102. ptloop0:mov     ecx,12
  103. ptloop1:cmp     byte ptr [esi+eax],255
  104.         jne     noput
  105.         mov     byte ptr [edi+ebp],bl
  106. noput:  inc     eax
  107.         inc     ebp
  108.         dec     ecx
  109.         jnz     ptloop1
  110.         add     eax,132-12
  111.         add     ebp,320-12
  112.         dec     edx
  113.         jnz     ptloop0
  114.         ret
  115.  
  116.         include asm\chinese.inc
  117.